﻿using System;
using System.Collections.Generic;
using System.Text;

namespace DBUtil.FastEntity.Annotations
{
    /// <summary>
    /// 将当前属性映射为表的关键列
    /// </summary>
    [AttributeUsage(AttributeTargets.Property)]
    public class MapKeyAttribute : MapColumnAttribute
    {
        /// <summary>
        /// 主键生成策略,默认: 自定义
        /// </summary>
        public KeyStrategy KeyStrategy { get; set; } = KeyStrategy.Custom;
    }

    /// <summary>
    /// 主键策略
    /// </summary>
    public enum KeyStrategy
    {
        /// <summary>
        /// 自增
        /// </summary>
        Identity,
        /// <summary>
        /// 分布式Id
        /// </summary>
        DistributedId,
        /// <summary>
        /// Guid
        /// </summary>
        Guid,
        /// <summary>
        /// 自定义
        /// </summary>
        Custom

    }
}
